package com.zline.foodraise.adapter;

import android.content.Context;
import android.view.ViewGroup;

import com.zline.foodraise.entity.UserAddressBean;
import com.zline.foodraise.listener.RecyclerItemClicked;
import com.zline.foodraise.view.AddrListItem;
import com.zline.foodraise.view.AddrListItem_;
import org.androidannotations.annotations.EBean;
import org.androidannotations.annotations.RootContext;

/**
 * Created by heshantao on 15/7/4.
 * poi检索地址
 */
@EBean
public class AddrListAdapter extends RecyclerViewBaseAdapter<UserAddressBean, AddrListItem> {
    private static final String LOG_TAG = AddrListAdapter.class.getSimpleName();
    @RootContext
    Context cxt;


    @Override
    protected AddrListItem onCreateItemView(ViewGroup parent, int viewType) {
        return AddrListItem_.build(cxt);
    }

    @Override
    public void onBindViewHolder(ViewWrapper<AddrListItem> holder, int position) {
        AddrListItem view=holder.getView();
        UserAddressBean  addressBean=arrys.get(position);
        view.setListener(itemClicked);
        view.bind(addressBean,position);
    }


}
